﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace TTIServer.TTISettings.PenLayouts
{
	/// <summary>
	/// Interaction logic for UserControl1.xaml
	/// </summary>
	public partial class PenLayout : UserControl
	{

		//FrontBarrelCombo
		//RearBarrelCombo
		//TipSwitchCombo
		//EraserCombo
		//EraserSlider
		//EraserPrgBar

		public PenLayout( String PenID )
		{
			InitializeComponent();
			AddPenImage(PenID);
			HideAndShowPenControls(PenID);
			
		}

		private void AddPenImage(string PenID)
		{
			//Cintiqs cannot use styli numbered as 000X0X, they can use 100X0X+.
			switch (PenID)
			{
				case "100802":
				case "Grip Pen":
					PenImg.BeginInit();
					PenImg.Source = new BitmapImage(new Uri("../../../Resources/GripPenNormal.png", UriKind.RelativeOrAbsolute));
					PenImg.EndInit();
					break;
				case "100804":
				case "Art Pen":
					PenImg.BeginInit();
					PenImg.Source = new BitmapImage(new Uri("../../../Resources/ArtPen.png", UriKind.RelativeOrAbsolute));
					PenImg.EndInit();
					break;
				case "100902":
				case "Airbrush Pen":
					PenImg.BeginInit();
					PenImg.Source = new BitmapImage(new Uri("../../../Resources/AirBrushPen.png", UriKind.RelativeOrAbsolute));
					PenImg.EndInit();
					break;
				case "Ink Pen":
				case "120802":
					PenImg.BeginInit();
					PenImg.Source = new BitmapImage(new Uri("../../../Resources/Inkling.png", UriKind.RelativeOrAbsolute));
					PenImg.EndInit();

					break;
				case "Classic Pen":
				case "140802":
					PenImg.BeginInit();
					PenImg.Source = new BitmapImage(new Uri("../../../Resources/ClassicPen.png", UriKind.RelativeOrAbsolute));
					PenImg.EndInit();
					break;
				//case "Pro Pen":
				//case "160802": //Grip Pen Pro (Pro Pen)
				//	PenImg.BeginInit();
				//	PenImg.Source = new BitmapImage(new Uri("../../../Resources/GripPenNormal.png", UriKind.RelativeOrAbsolute));
				//	PenImg.EndInit();
				//	break;
			}

		}

		private void HideAndShowPenControls( string PenID)
		{
			switch (PenID)
			{
				case "100802":
				case "Grip Pen":
				case "100804":
				case "Art Pen":
				case "Classic Pen":
				case "140802":
					EraserControlPanel.Visibility = Visibility.Visible;
					BackBarrelCombo.Visibility = Visibility.Visible;
					FrontBarrelCombo.Visibility = Visibility.Visible;
					EraserCombo.Visibility = Visibility.Visible;
					break;
				case "Airbrush Pen":
				case "100902":
					EraserControlPanel.Visibility = Visibility.Visible;
					BackBarrelCombo.Visibility = Visibility.Visible;
					FrontBarrelCombo.Visibility = Visibility.Collapsed;
					EraserCombo.Visibility = Visibility.Visible;
					break;
				case "Ink Pen":
				case "120802":
					BackBarrelCombo.Visibility = Visibility.Collapsed;
					FrontBarrelCombo.Visibility = Visibility.Collapsed;
					EraserControlPanel.Visibility = Visibility.Collapsed;
					EraserCombo.Visibility = Visibility.Collapsed;
					break;

			}



		}

		private void CheckBox_Checked(object sender, RoutedEventArgs e)
		{

		}

		private void Rectangle_MouseEnter(object sender, MouseEventArgs e)
		{

		}

		private void Rectangle_MouseEnter(object sender, StylusEventArgs e)
		{


		}

		private void TipRectangle_MouseLeave(object sender, MouseEventArgs e)
		{
			

			

		}
	}
}

	   //void SetPenImage(String WhichImage)
	   //{
	   //	BitmapImage inBI;

	   //	switch (WhichImage)
	   //	{
	   //		case "802":
	   //		case "80C":
	   //			inBI = new BitmapImage(new Uri("Resources/LargeGripPenCustom.png", UriKind.RelativeOrAbsolute));
	   //			break;
	   //		case "804":
	   //		case "80A":
	   //			inBI = new BitmapImage(new Uri("Resources/LargeArtPen.png", UriKind.RelativeOrAbsolute));
	   //			break;
	   //		default:
	   //			inBI = new BitmapImage(new Uri("Resources/GripPenPro.png"));
	   //			break;
	   //	}

	   //	PenImage.BeginInit();
	   //	PenImage.Source = inBI;
	   //	PenImage.EndInit();
	   //}